from rest_framework.response import Response
from rest_framework.views import APIView

from six_it.models import Recruit


class VisitRecruitsView(APIView):
    # 增加职位访问次数

    def put(self, request, id):
        recruit = Recruit.objects.get(id=id)
        recruit.visits += 1
        recruit.save()
        return Response({"message": "更新成功",
                         "success": True})
